|
|
Chris Huff <chr### [at] maccom> wrote:
: What benefits? A small parsing speedup every once in a while, and more
: rarely a fairly large speed improvement. And this can already be
: accomplished by using a slightly different structure with the current
: language, by nesting the conditionals.
Why should the user optimize by hand when povray could do it automatically?
: Oh, and it lets you write nicely obfuscated code that doesn't do what it
: appears to do, like this:
: #if(ACondition & DoSomething()) #end
But you can already make pretty obfuscated code with povray. Just consider
something like this:
#local L=array[4800] #local Y=-2; #local I=0;
#while(#local X=-2;
#while(#local Zr=X; #local Zi=Y; #local N=0;
#while(#local A=Zr*Zr; #local B=Zi*Zi;
#local Zi=2*Zr*Zi+Y; #local Zr=A-B+X;
#local N=N+1; N<20&A+B<2) #end
#local L[I]=<X,N/40,Y>;
#local X=X+.05; #local I=I+1; X<=1) #end
#local Y=Y+.05; Y<=2) #end
union
{ #local I=0; #while(I<4800) sphere{L[I],.05} #local I=I+1; #end
pigment { rgb x } finish { specular .5 }
}
camera { location <-2,2,-2> look_at 0 }
light_source { <0,20,-10>, 1 }
Avoiding a feature only because you CAN make obfuscated code with it is
not a good principle.
If that had been the principle in povray, its scripting language would not
be as versatile as it is now (and things like macros would have been had to
be implemented in a completely different way as it is now).
If povray can optimize the speed of the parsing, that's only a good thing.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|